Imports Clo = Enhancements.Core.Logging
Imports Ref = System.Reflection
Imports Sys = System

Namespace Enhancements.Basic
    ''' <summary>The exception that is thrown when a string is not in a regular expression.</summary>
    <Serializable(), DebuggerStepThrough()> _
    Public NotInheritable Class IsInRegularExpressionNotException
        Inherits AssertException

        Private Sub New(ByVal _objectName As System.String, ByVal _object As System.String, ByVal _objectRegularExpression As System.String)
            MyBase.New(_objectName)
            [Object] = _object
            ObjectRegularExpression = _objectRegularExpression
        End Sub

        Private Sub New(ByVal _objectName As System.String, ByVal _object As System.String, ByVal _objectRegularExpressionArray() As System.String)
            MyBase.New(_objectName)
            [Object] = _object
            ObjectRegularExpressionArray = _objectRegularExpressionArray
        End Sub

        Private __Object As System.String = Nothing
        ''' <summary>Gets the value of the object that caused this exception.</summary>
        Public Property [Object]() As System.String
            Get
                Return __Object
            End Get
            Private Set(ByVal _value As System.String)
                __Object = _value
            End Set
        End Property

        Private __ObjectRegularExpression As System.String = Nothing
        ''' <summary>Gets the value of the regular expression. Only one of the ObjectRegularExpression and ObjectRegularExpressionArray properties is used. If the value here is Nothing then the ObjectRegularExpressionArray property might be in use.</summary>
        Public Property [ObjectRegularExpression]() As System.String
            Get
                Return __ObjectRegularExpression
            End Get
            Private Set(ByVal _value As System.String)
                __ObjectRegularExpression = _value
            End Set
        End Property

        Private __ObjectRegularExpressionArray() As System.String = CType(Sys.Array.CreateInstance(GetType(System.String), 0), String())
        ''' <summary>Gets the value of the regular expression array. Only one of the ObjectRegularExpression and ObjectRegularExpressionArray properties is used. If the value here is a 0-length array then the ObjectRegularExpression property might be in use.</summary>
        Public Property ObjectRegularExpressionArray() As System.String()
            Get
                Return __ObjectRegularExpressionArray
            End Get
            Private Set(ByVal _value() As System.String)
                __ObjectRegularExpressionArray = _value
            End Set
        End Property

        ''' <summary>Throws an exception.</summary>
        ''' <param name="_objectName">Name of the object that is causing the exception.</param>
        ''' <param name="_object">Object that is causing the exception.</param>
        ''' <param name="_objectRegularExpression">Regular expression that is causing the exception.</param>
        ''' <exception cref="IsInRegularExpressionNotException"> </exception>
        Friend Shared Sub ___Throw(ByVal _objectName As System.String, ByVal _object As System.String, ByVal _objectRegularExpression As System.String)
            Dim _exception As IsInRegularExpressionNotException = New IsInRegularExpressionNotException(_objectName, _object, _objectRegularExpression)

            Throw _exception
        End Sub

        ''' <summary>Throws an exception.</summary>
        ''' <param name="_objectName">Name of the object that is causing the exception.</param>
        ''' <param name="_object">Object that is causing the exception.</param>
        ''' <param name="_objectRegularExpressionArray">Regular expression array that is causing the exception.</param>
        ''' <exception cref="IsInRegularExpressionNotException"> </exception>
        Friend Shared Sub ___Throw(ByVal _objectName As System.String, ByVal _object As System.String, ByVal _objectRegularExpressionArray() As System.String)
            Dim _exception As IsInRegularExpressionNotException = New IsInRegularExpressionNotException(_objectName, _object, _objectRegularExpressionArray)

            Throw _exception
        End Sub

    End Class
End Namespace
